// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import 'babel-polyfill'
import Vue from 'vue'
import ElementUI from 'element-ui'
import App from './App'
import router from './router'
import numbro from 'numbro'
import VueCodeMirror from 'vue-codemirror'
import Extend from './assets/extend'
require('font-awesome-webpack')
require('common/style/index.css')
require('element-ui/lib/theme-default/index.css')

Vue.config.productionTip = false
Vue.prototype.$numbro = numbro
// router.beforeEach((to, from, next) => {
//   axios.get('/session/check').then(res => {
//     if (res.data.status === 0) {
//       next()
//     } else {
//       // 测试环境
//       // window.location.href = 'http://10.21.32.204:19090'
//       // 正式上线将下一行打开
//       // window.location.href = 'http://10.21.32.200:19090'
//       // window.location.href = 'http://localhost:19090'
//       // window.location.href = 'http://10.21.32.204:19090/dc-meta-server'
//       // window.location.href = 'http://10.21.32.200:19090'
//     }
//     if (to.name === null) {
//       next({
//         path: '/overview'
//       })
//     } else {
//       next()
//     }
//   })
// })

require('jquery')
Vue.use(ElementUI)
Vue.use(VueCodeMirror)
Vue.use(Extend)

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  render: h => h(App)
})
